Input/Output¶
GPIO¶
In this window, each individual GPIO (General Purpose Input/Output) behavior can be configured:
Signal: Pin ID as described in Hardware installation -> Pinout section of the MEX user manual.
GPIOId: GPIO ID of the microcontroller.
IO: Define GPIO as an input or ouput.
Pull-up: Enable or disable the pull-up resistance.
Function: Mux 0/GPIO: GPIO, Mux 1: PWM, Mux 2 or Mux 3. These are the different functionalities that the GPIO can have, depending on the multiplexer.
Qsel: This is the “input qualification”, it is used to control how the value of a GPIO is evaluated. The available options are:
Sync: The value is taken as the time it is checked (synchronously). This is the default mode of all GPIO pins.
3 Samples: The value is checked 3 times and the value is only changed when the 3 times are the same.
6 Samples: Same as 3 samples, but checking 6 times instead of 3.
ASync: No checks are performed. It is used when it is not used as GPIO.
PWM¶
In this section each PWM can be configured:
Note
PWMs in MEX work in normalized mode, when the input value is 0 the output value will be the minimum configured, and when the input value is 4095 (12 bits all with ones), the output will be the maximum configured. This approach allows usage of the maximum resolution for the commanded value.
Enable: Define if the PWM is enabled or not.
Sub id: Identifies the sub-id of the PWM and, according to this value, determines the command to be used using one type of CAN message or another.
Frequency: PWM output frequency.
Timeout: If a PWM message is not received in less than this time, the PWM will send as output the start value.
Start value: Value used before any PWM message arrives and on timeout.
Pulse source ID: PWM input ID [0,3], defined in the Digital Input section.
Active High: Polarity high or low.
Mode: Time or Duty cicle.
Min: Minimum value. It will be the output when the PWM message specifies 0.
Max: Maximum value. It will be the output when the PWM message specifies 4095.
An example about reading PWM signals can be found in the Integration example section, click here.
I/O Setup¶
In this panel the user can stablish the relationship between a determined signal with a I/O port. This allows users to configure external sensors, custom messages, etc.
Priority: Connections between I/O ports can be marked with high priority with this checkbox. If enabled, they will run at high frequency: 1000 Hz.
Producer: Functions for creating and sending messages.
Consumer: Functions for receiving and parsing messages.
Bit: This assigns each connection a bit in a way that allows this connection to be activated/deactivated depending on the status of the selected bit.
By default, the ‘Always Ok’ bit is set to all connections so that they are always active.
Firstly, user has to configure the Producer selecting the I/O port or information to use. Later, user has to configure the Consumer by clicking on an element, a new window will be displayed to select an item. The relationship between them can be unidirectional (Bind) or bidirectional (Bind Bidirectional), the last enables a port to receive or send information.
The following I/O ports are available:
Field |
Description |
---|---|
RS232-A |
Serial Port 232 A |
RS232-B |
Serial Port 232 B |
RS485 |
Serial Port 485 |
Commgr port |
COM Manager Port |
Tunnel |
Creates a bidirectional brigde between two devices, see Tunnel |
Custom message producer/consumer |
This allows user to send/receive a serial custom message, see Custom messages |
CAN to serial / Serial to CAN |
Serial to CAN sends serial streams over a CAN Bus / CAN to serial undoes the transformation ‘Serial to CAN’ |
CAN wrapper for serial transmission / Serial CAN unwrapper |
CAN wrapper sends CAN streams over a serial Bus / Serial CAN unwrapper undoes this transformation |
Tribunus ESC |
Reads telemetry data from the Tribunus ESCs by connecting it to one of the serial ports |
Lift - MCU |
Created for communication with a Lift MCU |
JETI box |
Simulates a Jetibox to read telemetry from legacy Jeti devices, see JETI box |
JETI telemetry |
Reads telemetry from Jeti devices |
Tunnel¶
A tunnel is a bidirectional bridge between units that communicate each other. The following image shows an example of tunnel configuration:
In the previous image there is a device connected to the RS232-A (Producer) and there is a Tunnel (Consumer) which sends that information to all units on network (Broadcast). On the other hand, an Autopilot 1x unit has to be configured to receive the signal sent by another device. In this case, the Producer will be Tunnel, while Consumer will be the port or destination tunnel where the device is connected.
The options available when configuring Tunnel as consumer are:
Veronte ID: Select the address that will receive the information.
App 2: Veronte Ops address.
Broadcast: All units on the network. Select this option for a generic configuration.
MEX XXXXXX Address of a specific unit, it may be a MEX, an autopilot 1x, a 4x, etc.
Parser: The user can choose protocol to parse message data. The options available are:
No protocol
RTCM3
CAN serial
Destination tunnel: Number of port is used to avoid mistakes and identify each Tunnel when using more than one. Tunnel 1, 2 and 3 are available.
Time between messages.
Bytes to send: Sets the message size to send.
When configuring Tunnel as Producer (i.e. on the unit that receives the information), no configuration is required. It is only necessary to connect it to a Consumer, usually to a serial port.
Serial custom Messages¶
Warning
MEX has the following limitations for serial messages:
10 maximum vectors.
32 maximum fields (adding all serial messages).
It is possible to configure messages sent and received through the serial port and its conversion to system variables. To do that, select the option Custom message producer/consumer and configure the I/O port.
The previous image illustrates two possible configurations using a Custom Message.
The red one is configured to receive a message from Tunnel 1 and the green is used to send a Custom Message through a the RS485-C serial port. It is also possible to use the same Custom Message for both tasks if Bind Bidirectional is used (the arrow indicates this).
To configure a Custom message, the user must follow the next steps:
Press the configuration button ( icon) and another window will be displayed.
In this window press the + icon to add a custom message.
When it is already added, the following options are available to configure a custom message:
Endianness: Depending on the order the message is made, it is possible to select:
Big endian: Set value from left to right.
Little endian: Set value from right to left.
Mixed endian: Some devices use this format. If users need to configure it, please contact the support team (create a ticket in the customer’s Joint Collaboration Framework; for more information, see Tickets section of the JCF manual).
Period/Time out: This option has a dual role depending on whether it is used to transmit or receive data.
Period - Producer: Time between produced messages.
Time out - Consumer: Time threshold between receptions to consider that messages are not received correctly.
Delay/Time to Idle: This option has a dual role depending on whether it is used to transmit or receive data.
Delay - Producer: Delay applied before sending the message. This serves to send messages with the same period without overloading the Serial bus.
Time to Idle - Consumer: Time that MEX waits before discarding partially parsed bytes.
Bit ID: This option is only available when a message is configured as Consumer. The user bit selected in Bit ID box will be true if the message is being received correctly.
Warning
Pay attention that the user bit selected in Bit ID is not in use for another task.
To create the structure of the message, click on and then press the “+” icon to add fields to it. The following fields are available to configure a structure: Variable, Checksum, Matcher, Skip, Parse ASCII and Position.
The configuration of each structure is covered in Custom Messages section of the 1x PDI Builder manual.
Warning
Before configuring any message, user has to know the structure according to the device that is connected to the port. Each device may have a different message structure when it sends or receives information.
JETI box¶
JETIBOX is a universal communication terminal which can be used with any JETI products.
JETIBOX operates as a two-way terminal, showing all data stored. Employing its four buttons, users browse its menu and set the selected values.
To simulate it, it is necessary to link the specific JETI box IO consumer to a serial port:
Then, the sequence to retrieve data shall be configured by clicking on .
To add a Custom Message, clik on the + icon:
The following parameters can be configured in the previous pop-up window:
Endianness: Depending on the order in which the device issues the message, it is possible to select:
Big endian: Sets values from left to right.
Little endian: Sets values from right to left.
Mixed endian: Some devices use this format. If users need to configure it, please contact the support team (create a ticket in the customer’s Joint Collaboration Framework; for more information, see Tickets section of the JCF manual).
Command: Here the user can select between Jeti box Left, Jeti box Down, Jeti box Up, Jeti box Right or Jeti box Nop.
These correspond to the four buttons on the physical JETIBOX (see image above), except the Jeti box Nop that is only for simulating a “wait”.
For example, to read the Actual Voltage of a Jeti MasterSpin 220 the Consumer must be configured with a series of custom messages (use Big endian for all messages).
The following example shows the configuration of one of these messages, the full example can be found in Jetibox explanation of the Integration examples section.
Expected text: “CONTROLLER TYPE MasterSpin 220~”
Command: Jeti box Down
Matcher(32) “CONT” 0x434F4E54 (1129270868)
Skip(24*8) 192
Matcher(32) “220~” 0x3232307E (842150014)
CAN I/O¶
A CAN (Controller Area Network) Bus is a robust standard communication protocol for vehicles widely used in the aviation sector. MEX has two CAN buses that can be configured independently.
The structure of a CAN message can be seen in the following image:
Only the ID is introduced in the system, the rest of the message layout is already coded. The data field is built by the user to send, and parsed when received.
For more information on the CAN Bus protocol, see CAN Bus protocol section of the MEX Software manual.
The baud rate of both CAN buses can be configured in the CAN Setup section.
Configuration¶
This menu allows the configuration of the CAN inputs and outputs.
In this menu, the user can find the same ‘columns’ as in the I/O Setup menu.
MEX has the following list of producers:
Application Processor: Sends a specific set of information, the “status message”.
This message is composed as: version (
major
.minor
.revision
), address (serial number), system bit error, system power up bit error, PDI bit error, memory allocation bit, fily system bit error, CAN A bit error, CAN B bit error, arbiter enabled and arbiter status.
CAN Input Filter: Those CAN messages received in one filter can no longer be received in subsequent filters.
The following parameters need to be configured by clicking on :
Port: It is required to configure the CAN bus from which it listens, the user can choose between CAN A, CAN B or BOTH.
Id: CAN Id must be set and it is used to identify messages. The value set has to be decimal format.
Mask: A CAN Id mask can be set to filter messages. The mask defines the bits that should match.
For example, to admit standard Ids (11 bits) from 8 to 11 (100 to 111 in binary) the user should set the mask to binary 11111111100, that is 2044 in decimal.
Warning
Make sure that mask is set properly to be able to receive the desired CAN messages.
Filter type: The available options are Standard (frame format with a 11-bit identifier), Extended (frame format with a 29-bit identifier) and Both.
CAN unwrapper: This undoes the ‘CAN serial wrapper’ action, it has to be connected to I/O Setup consumer (Serial CAN unwrapper).
Serial to CAN: Serial messages through CAN output, it has to be connected to I/O Setup consumer. It can be configured in , a pop-up window will appear:
Id: CAN Id must be set and it is used to identify messages. The value set has to be decimal format.
Extended: If it is enabled, the frame format will be ‘Extended’, i.e. with a 29-bit identifier. Otherwise, the frame format ‘Standard’ (11-bit identifier) is set by default.
Time out: This is the threshold time between receptions to consider that it is not being received correctly.
CAN Telemetry: Telemetry messages sent via CAN (such as CAN custom messages on Veronte Autopilot 1x to MEX). They are configured in the next section: CAN Telemetry.
The consumers are explained in the following list:
Application Processor: Receives a specific set of information sent by Veronte Autopilot 1x or Arbiter.
CAN Output Filter: CAN output filters. The user can choose between CAN A, CAN B or BOTH in .
CAN serial wrapper: CAN messages through serial output, it has to be connected to I/O Setup producer (CAN wrapper for serial transmission).
CAN GPIO consumer: CAN messages from Veronte Autopilot 1x or 4x for GPIO inputs. An example of how to implement it can be found in Integration Examples.
CAN to Serial: This undoes the ‘Serial to CAN’ action, it has to be connected to I/O Setup producer.
CAN telemetry¶
In the CAN Telemetry tab, the user chooses the telemetry to be sent/received through CAN bus. The following element can be configured:
TX: is employed to configure transmitted messages.
Warning
MEX has the following list of limitations:
The maximum capacity of a CAN message is 64 bits (8 bytes), so to send more information it must be divided into several messages.
CAN limitations:
Maximum number of vectors (fieldsets): 7.
Maximum number of fields: 32 (adding all CAN messages).
Since this section works similar to the 1x PDI Builder software, the explanation to configure the telemetry messages via CAN is reflected in the 1x PDI Builder manual, like the configuration of the CAN custom messages.
An example of the sending of CAN telemetry messages can be found in the Integration example section.
Digital Input¶
Digital inputs can be used to measure pulse count, pulse widths and PPM signals from a RC radio. Each source shall be connected to the desired consumer to allow measurements.
In addition, in this menu the user can also find the ‘Bit column’ in the same way as in the I/O Setup and CAN I/O sections:
Bit: This assigns each connection a bit in a way that allows this connection to be activated/deactivated depending on the status of the selected bit.
By default, the ‘Always Ok’ bit is set to all connections so that they are always active.
The process to configure a device can be done as follows:
Select and configure a Producer to read the external signal. There are 4 possible producers: CAP 1 - 4.
Press on the configuration button and a pop-up window will show.
In the pop-up window, users can check:
Whether this producer is enabled.
Which pin this CAP is associated to and, therefore, to which device is connected. They are associated in this way: CAP 1 with I/O1, CAP 2 with I/O2, CAP 3 with I/O3 and CAP 4 with I/O4.
How pulses are read and transformed into a digital signal (how they are processed). That can be configured with the Edge detection option.
First rising edge: With this option, when the rise of the pulse is detected, the data will start to be stored. Recommended when consumer is PPM or Pulse.
First falling edge: With this option, when the fall of the pulse is detected, the data will start to be stored.
Note
By clicking on the marked arrows, it can also be configured as desired. For example, if the user has selected the ‘First rising edge’ option, but cliking on the arrows gets the arrow scheme of another defined edge detection option, the name of the edge detection will not be ‘First rising edge’, but will become that edge detection option’s name.
Click on the Bind button to select the type of Consumer, it is possible to choose PPM0 (Stick PPM), RPM 1-4 (RPM Sensor) or Pulse 1-4 (Pulse Sensor).
PPM 0: The variable where the information is stored is ‘PPM channel 1 output’. Stick PPM is configured in the Stick section.
RPM 1-4: The variables where the information read here is stored are ‘RPM 1-4’. For more information about RPM configuration, read the RPM section.
Pulse 1-4: The variables where the information is stored are ‘Captured pulse 1-4’. It is possible to configure it clicking on .
In the pop-up window, users will find the following options:
Mode:
Positive pulse duration: The period of the pulse is obtained. It takes the time in ‘High’ state.
Negative pulse duration: The period of the pulse is obtained. It takes the time in ‘Low’ state.
Positive duty cycle: The duty cycle of the pulse is obtained. It takes the time in ‘High’ state.
Negative duty cycle: The duty cycle of the pulse is obtained. It takes the time in ‘Low’ state.
Time out: This defines the time to consider that no signal is received.
Function: Here the user can customize a function to handle values. Normally, a function is set with the points [0,0] and [1,1], so no transformation is applied (output = input). However, the user can configure it as desired.
Example
Let selected First rising edge as the edge detection option in Producer and the pulse that MEX has to read is a square signal with a period of 2 seconds and a duty cycle of 25% (see the image below).
If Positive pulse duration is selected as Consumer and it has been configured as in the previous image (Digital Input - Pulse), it will get 0.50 s as value in the variable Captured pulse (Captured pulse 1 in the following example), since it corresponds to the period of the “positive pulse” of that pulse.
Nonetheless, if Positive duty cycle is selected as Consumer, it would have 0.25 as value in Captured pulse (Captured pulse 2 in the following example), since it corresponds to the positive cycle of that pulse.
SCI¶
MEX can use up to three serial peripherals (SCI A, SCI B and SCI C). Serial ports A, B and C parameters can be edited in this menu to fit the serial protocol requirements.
Baudrate: How fast data is sent over a serial line.
Length: Number of data bits for each character: 4 to 8 bits.
Stop: Number of stop bits sent at the end of each character: 1, 1.5 or 2.
Parity: Method to detect errors during transmission. When parity is used with a serial port, an extra data bit will be sent with each data character. The bits of each character (including parity bit) will be even or odd according to parity mode (odd, even or disabled).
Use address mode: 9-bit data framing uses the bit typically associated with parity error detection to identify address messages. Sent serial data that does not have the address bit set will be ignored (unless the device had previously identified an address message associated with it). This option can be disabled or enabled.
Note
SCI A corresponds to port RS232 A, SCI B to port RS232 B and SCI C to port RS485.
CAN Setup¶
Main screen to enable an internal resistor and configure baudrate and reception mailboxes of each CAN Bus.
By activating ‘Enable Terminator’, the internal MEX resistor of 120 \(\Omega\) is activated. For more information on this resistor, refer to the Electrical diagram of CAN bus -> Hardware Installation section of the MEX Hardware Manual.
More information about Mailboxes can be found in the Mailboxes section of the 1x PDI Builder user manual.
Custom Msg Trigger¶
This menu allows the user to send custom messages (which have been previously configured) every time there is a new magnetometer reading/measurement.
It works similar to the Custom CAN TX and Custom Serial TX automations of 1x PDI Builder software.
In this case, the “automation” will work like this:
Events: Each new magnetometer reading/measurement.
Action: Sending of the custom message already configured.
Users can configure custom messages to be sent via serial or CAN:
The two parameters to configure in this menu are:
Producer: The user has to specify where the custom message is located (mailbox):
For serial: Custom message producer 1 or 2.
For CAN: CAN Telemetry
Message ID: The number of the custom messages that will be sent.
Warning
As it is used to send a single message on demand, in its configuration in Custom Messages, the user has to set its period to -1. This way, this message will only be sent when there is a new magnetometer reading/measurement.
For CAN communications, do not confuse it with the CAN ID of the custom message: